COMPONENT=ApplicationAppC

######## TINYOS OPTIONS #######################
CFLAGS += -DCC2420_DEF_RFPOWER=31	# Radio RF power (min: 3 - max: 31)
CFLAGS += -DCC2420_DEF_CHANNEL=26	# Wireless Channel selection Range: 11..26
CFLAGS += -DTOSH_DATA_LENGTH=50		# Payload length

######## DISSENSE OPTIONS #####################
#CFLAGS += -I$(TOSDIR)/lib/printf		 #Enable Printf
#CFLAGS += -DPRINTF_BUFFER_SIZE=512	 #Set Printf Buffer size
CFLAGS += -DDISABLE_SKIP			# Disable the skip period


####### MOTE SPECIFIC OPTIONS #################
CFLAGS += -DDISSENSEDEBUG	# Debug printing in application data packet (it should be DISABLED)
#CFLAGS += -DLOG
CFLAGS += -DSOLAR
#CFLAGS += -DSERIAL
#CFLAGS += -DSINK 
#CFLAGS += -DRELAY_NODE
 
#CFLAGS += -DNOLEDS
CFLAGS += -I./sensor

######## DO NOT CHANGE ########################
CFLAGS += -I./adaptation -I./cc2420 -I./interfaces/ -I./ctp/ -I$(TOSDIR)/lib/net/ -I$(TOSDIR)/lib/net/ctp -I$(TOSDIR)/lib/net/4bitle

CFLAGS += -DLOW_POWER_LISTENING		# LPL enabled

BUILD_EXTRA_DEPS = SinkGatewayMsg.class HeartBeatMsg.class DataMsg.class FlashLogMsg.class

SinkGatewayMsg.class: SinkGatewayMsg.java
	javac SinkGatewayMsg.java
	
SinkGatewayMsg.java: NtpManager.h
	mig java -target=$(PLATFORM) $(CFLAGS) -java-classname=SinkGatewayMsg NtpManager.h sinkGatewayMsg -o $@
	
HeartBeatMsg.class: HeartBeatMsg.java
	javac HeartBeatMsg.java	
	
HeartBeatMsg.java: NtpManager.h
	mig java -target=$(PLATFORM) $(CFLAGS) -java-classname=HeartBeatMsg NtpManager.h heartBeatMsg -o $@
	
DataMsg.class: DataMsg.java
	javac DataMsg.java	
	
DataMsg.java: Application.h
	mig java -target=$(PLATFORM) $(CFLAGS) -java-classname=DataMsg Application.h packet_received -o $@
	
FlashLogMsg.class: FlashLogMsg.java
	javac FlashLogMsg.java	
	
FlashLogMsg.java: Application.h
	mig java -target=$(PLATFORM) $(CFLAGS) -java-classname=FlashLogMsg Application.h flashLogMsg -o $@


include $(MAKERULES)
